package com.sg.service.biz.component.nb;

import cn.hutool.core.bean.BeanUtil;
import com.sg.dto.biz.component.req.TransitionStepReqDto;
import com.sg.dto.biz.component.res.TransitionStepRespDto;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.stereotype.Service;

/**
 * @author ： 手工接入方法
 * @version 1.0
 * @since 2022/5/28 15:32
 */
@Service
public class NbOffState {
    /**
     * code:receptionService
     * name:M2-获取接收字段
     * desc:undefined
     * gen by moon at 10/24/2022, 12:52:59 AM
     **/
    @Trace(operationName = "M2-获取接收字段")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    public ObtainReceiveFieldsRespDto obtainReceiveFields(ObtainReceiveFieldsReqDto reqDto) {
        return BeanUtil.toBean(reqDto, ObtainReceiveFieldsRespDto.class);
    }

    /**
     * code:rowToColumn
     * name:2-9评价模板高层步骤标识行转列
     * desc:undefined
     * gen by moon at 10/24/2022, 12:53:07 AM
     **/
    @Trace(operationName = "2-9评价模板高层步骤标识行转列")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    public TransitionStepRespDto transitionStep(TransitionStepReqDto reqDto) {
        TransitionStepRespDto retData = new TransitionStepRespDto();
        if (reqDto.getStepCode1() != null) {
            retData.getStepList().add(reqDto.getStepCode1());
        }
        if (reqDto.getStepCode2() != null) {
            retData.getStepList().add(reqDto.getStepCode2());
        }
        if (reqDto.getStepCode3() != null) {
            retData.getStepList().add(reqDto.getStepCode3());
        }
        if (reqDto.getStepCode4() != null) {
            retData.getStepList().add(reqDto.getStepCode4());
        }

        return retData;
    }
    //手工接入方法
}
